package com.example.demo.service.imp;

import com.example.demo.dao.UserDao;
import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Date:2021/6/29 11:09
 * @Author:郑伟
 * @Version:1.1.0
 */
@Service
public class UserImp implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public int login(String name,String password) {
        return userDao.findByUsernameAndPassword(name,password).size();
    }
}
